#ifndef MYGRAPH_H_INCLUDED
#define MYGRAPH_H_INCLUDED

#include <iostream>
#include <string>
using namespace std;

class EdgeNode{
    friend class MyGraph;
    friend class VertexNode;
private:
    int dest;
    EdgeNode* link; 

public:
    EdgeNode();
    EdgeNode(int, EdgeNode*);
    ~EdgeNode();
    int getDest();
    EdgeNode* getNext();
    void setDest(int);
    void setNext(EdgeNode*);
};

class VertexNode{
    friend class MyGraph;
    friend class EdgeNode;
private:
    char data;
    EdgeNode* firstEdge;

public:
    VertexNode();
    VertexNode(char, EdgeNode*);
    ~VertexNode();
    char getData();
    EdgeNode* getFirstEdge();
    void setData(char);
    void setFirstEdge(EdgeNode*);
};

class MyGraph{
private:
    int nodeNum;
    int edgeNum;
    VertexNode* VexList;

public:
    MyGraph();
    MyGraph(int, int, char*, int*, int*);
    ~MyGraph();
    int getNodeNum();
    int getEdgeNum();
    string printGraph();

    void DFS(int, int*, string&);
    void BFS(int, int*, string&);

    string graph_BFS_Traverse();
    string graph_DFS_Traverse();
};


#endif // MYGRAPH_H_INCLUDED
